home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1125 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: ipg.umds.ac.uk!newsadm
  2. From: "A.Bhalerao" <a.bhalerao@umds.ac.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Template Class Linkage?
  5. Date: 9 Jan 1996 13:55:21 GMT
  6. Organization: United Medical & Dental Schools, Guy's & St.Thomas' Hosp. London
  7. Message-ID: <4cts49@news-ipg.umds.ac.uk>
  8. References: <4cmnjs$mk7@mimsy.cs.umd.edu> <4cq4hs$raa@news2.deltanet.com> <4crpps$7ni@mimsy.cs.umd.edu> <1996Jan9.004515.8691@ohstpy>
  9. NNTP-Posting-Host: mimi.umds.ac.uk
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.01 9000/735)
  14. X-URL: news:1996Jan9.004515.8691@ohstpy
  15.  
  16. You don't have to include the template methods in the header files
  17. if the compiler uses some non-standard way of keeping track of
  18. template symbols. HP-UX and Sun CCv4 uses databases for templates
  19. (by default theses are subdirectories created by the compiler -
  20. ptrepository and Templates.DB respectively). I've found that HP-UX
  21. seems to be more tolerant than the Sun implementation and even
  22. supports templated code in libraries. With g++, you appear to have to 
  23. include source with the header otherwise the linker can't find
  24. the templated functions. One way round recompiling the templated
  25. code for each place it is used seems to be to use exemplars.
  26. In this manner I've managed to keep the templated code in 
  27. a library. In general, my experiences have shown that all of this
  28. area of C++ compiler behaviour is very hard to predict and consequently
  29. frustrating to use.
  30.  
  31.